The present invention relates to a method of restoring write data in the disk cache system and particularly to a method of restoring write data in a system for realizing high speed reading/writing between host and disk drive by storing read data sent from the disk drive in a cache memory, by storing the write data sent from the host in the cache memory and a non-volatile memory, and then restoring this write data in the disk drive during the idle time of disk drive.
In the disk cache system, the cache memory which operates at a higher speed and has a lesser capacity than the disk drive is provided between host and disk drive. At the time of a read operation, the data read from the disk drive is first stored in the cache memory and the host reads the data stored on this cache memory when an adequate time is available (for instance, when other processing is not being carried out). Moreover, at the time of the write operation, the write data is first stored in the cache memory, and this write data is transferred for writing to the disk drive when adequate time is available. Thereby, the host realizes high speed write and read operations for the disk drive in the same manner as those for ordinary memory without compensating for a difference in the processing speed for the disk drive and the current operating condition of the disk drive.
Particularly, a disk drive such as magnetic disk apparatus and an optical disk apparatus takes a longer time for access due to waiting time for rotation of the disk, but is capable of compensating for such an inconvenience by employing a disk cache system.
In this disk cache system, if a read operation fails due to some errors or a power failure at the time of reading data from the disk drive, the desired data may be read through direct access to the disk drive as required. Therefore, data loss is not caused.
However, in the case of a data writing operation, if the data writing operation fails due to power down or momentary interruption of data or errors during the data writing to the disk drive, a problem that the write data is lost may be caused because the host purges the write data after it has normally completed the data writing operation.
To protect data by preventing loss of data which may be caused during data writing, a battery backup system for cache memory has been proposed, so that the data written in the cache memory is no longer lost even when power down occurs. However, the method of restoring write data through a battery backup system for the cache memory as a whole is actually difficult to introduce, because the backup battery is required to have a large capacity when the cache memory has a capacity as large as several hundreds of megabytes, such as exists in a large scale system.
In order to overcome this problem, a method of restoring write data (for instance, Japanese Laid-open Patent No. 66727/1989) has been proposed. In this case, a nonvolatile memory having the battery backup system and a smaller capacity than the cache memory is provided additionally to such cache memory, the write data is stored in the cache memory and this nonvolatile memory and the write data control information is written in the nonvolatile memory.
Thereby, even when the cache memory has a large capacity, the write data can surely be rewritten owing to the small capacity nonvolatile memory and the small size backup battery.
As a method of restoring write data in the disk cache system, the method of storing the write data in a small capacity nonvolatile memory (which is in addition to, and different from, the above-mentioned cache memory) is capable of restoring the write data by preventing loss of write data due to a power failure during the write operation to the disk drive.
However, the existing method of restoring write data has been accompanied by the disadvantage that, if write data failure is generated by data error or momentary intermission of data during data writing to the nonvolatile memory, the defective data is written back because such defective condition is not controlled.